using System;
using System.Collections.Generic;
using System.Configuration.Provider;
using System.Text;

namespace Comics.Providers
{
	public sealed class DataProviderCollection : ProviderCollection
	{
		/// <summary>
		/// Gets a provider by its name.
		/// </summary>
		public new DataProvider this[string name]
		{
			get { return (DataProvider)base[name]; }
		}

		/// <summary>
		/// Add a provider to the collection.
		/// </summary>
		public override void Add(ProviderBase provider)
		{
			if (provider == null)
				throw new ArgumentNullException("provider");

			if (!(provider is DataProvider))
				throw new ArgumentException
						("Invalid provider type", "provider");

			base.Add(provider);
		}
	}
}